<?php
/**
 * Created by PhpStorm.
 * User: 沁塵
 * Date: 2019/4/20
 * Time: 19:57
 */

namespace app\api\controller\v1;

use app\lib\dou\DouTool;
use think\facade\Hook;

use think\facade\Request;

class Token
{
    /**
     * 抖店自研应用 获取access_token
     * @param('shop_id','店铺id','require|number')
     * @param('method','方法','require')
     * @return \think\response\Json
     */

    public function getToken()
    {


        $shop_id = Request::get("shop_id");
        $method = Request::get("method");
        $arr = ["code" => "","grant_type" => "authorization_self","shop_id" => $shop_id];
        $douTool = DouTool::getInstance();

        $obj = $douTool->getAccessToken($arr,$method);
        $result = json_decode($obj);
        return writeJson(200,$result,"ok");




    }



}